(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{104:function(e,t,a){e.exports=a(222)},145:function(e,t){},222:function(e,t,a){"use strict";a.r(t);var n=a(0),c=a.n(n),r=a(30),o=a.n(r),l=a(11),i=a(8),s=a(23);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var m=a(27),u=a(92),d=a(6),p=Symbol("LoginRequest"),g=Symbol("LoginFailure"),b=Symbol("LoginSuccess"),f=Symbol("RegisterRequest"),h=Symbol("RegisterFailure"),E=Symbol("RegisterSuccess"),v=Symbol("ConfirmRequest"),y=Symbol("ConfirmFailure"),N=Symbol("ConfirmSuccess"),k=Symbol("OAuthRequest"),O=Symbol("OAuthFailure"),j=Symbol("OAuthCallbackRequest"),x=Symbol("OAuthCallbackFailure"),S=Symbol("OAuthCallbackSuccess"),C=Symbol("FetchMeRequest"),w=Symbol("FetchMeSuccess"),I=Symbol("FetchMeFailure"),F={token:localStorage.getItem("token")||null,login:{error:null,processing:!1},registration:{errors:null,processing:!1,complete:!1},confirmation:{error:null,processing:!1},oauth:{error:null,processing:!1},oauthCallback:{error:null,processing:!1},me:{fetching:!1,profile:null}};var T=Symbol("FetchCategoriesRequest"),B=Symbol("FetchCategoriesSuccess"),R=Symbol("FetchCategoriesFailure"),M=[];var q=Symbol("WebsocketConnected"),_=Symbol("WebsocketDisconnected"),P=Symbol("Message"),A=Symbol("FetchMessagesRequest"),D=Symbol("FetchMessagesSuccess"),W=Symbol("FetchMessagesFailure"),Q={isWebsocketConnected:!1,messages:[]};var U=a(18),H=Symbol("CheckoutRequest"),L=Symbol("CheckoutSuccess"),z=Symbol("CheckoutFailure"),J={draft:{fetching:!1,errors:null}};var V=Symbol("FetchRecommendationsRequest"),G=Symbol("FetchRecommendationsSuccess"),K=Symbol("FetchRecommendationsFailure"),$=Symbol("FetchProductsByCategoryRequest"),X=Symbol("FetchProductsByCategorySuccess"),Y=Symbol("FetchProductsByCategoryFailure"),Z=Symbol("FetchProductsByQueryRequest"),ee=Symbol("FetchProductsByQuerySuccess"),te=Symbol("FetchProductsByQueryFailure"),ae=Symbol("FetchProductByIdRequest"),ne=Symbol("FetchProductByIdSuccess"),ce=Symbol("FetchProductByIdFailure"),re={recommendations:[],byCategory:{},byQuery:{},byId:{}};var oe=Object(m.d)(Object(m.c)({auth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:F,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case p:return Object(d.a)({},e,{login:Object(d.a)({},F.login,{processing:!0})});case b:return localStorage.setItem("token",t.token),Object(d.a)({},e,{login:F.login,token:t.token});case g:return Object(d.a)({},e,{login:Object(d.a)({},F.login,{error:t.error,processing:!1})});case f:return Object(d.a)({},e,{registration:Object(d.a)({},F.registration,{processing:!0})});case E:return Object(d.a)({},e,{registration:Object(d.a)({},F.registration,{processing:!1,complete:!0})});case h:return Object(d.a)({},e,{registration:Object(d.a)({},F.registration,{errors:t.errors,processing:!1})});case v:return Object(d.a)({},e,{confirmation:Object(d.a)({},F.confirmation,{processing:!0})});case N:return localStorage.setItem("token",t.token),Object(d.a)({},e,{confirmation:F.confirmation,token:t.token});case y:return Object(d.a)({},e,{confirmation:Object(d.a)({},F.confirmation,{error:t.error,processing:!1})});case k:return Object(d.a)({},e,{oauth:Object(d.a)({},F.oauth,{processing:!0})});case O:return Object(d.a)({},e,{oauth:Object(d.a)({},F.oauth,{error:t.error,processing:!1})});case j:return Object(d.a)({},e,{oauthCallback:Object(d.a)({},F.oauthCallback,{processing:!0})});case x:return Object(d.a)({},e,{oauthCallback:Object(d.a)({},F.oauthCallback,{error:t.error,processing:!1})});case S:return localStorage.setItem("token",t.token),Object(d.a)({},e,{oauthCallback:F.oauthCallback,token:t.token});case C:return Object(d.a)({},e,{me:Object(d.a)({},F.me,{fetching:!0})});case w:return Object(d.a)({},e,{me:Object(d.a)({},F.me,{profile:t.profile})});default:return e}},categories:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M,t=arguments.length>1?arguments[1]:void 0;return t.type===B?t.categories:e},chat:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case D:return Object(d.a)({},e,{messages:t.messages.concat(e.messages)});case q:return Object(d.a)({},e,{isWebsocketConnected:!0});case _:return Object(d.a)({},e,{isWebsocketConnected:!1});case P:return Object(d.a)({},e,{messages:e.messages.concat(t.message)});default:return e}},orders:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case H:return Object(d.a)({},e,{draft:Object(d.a)({fetching:!0,error:null},t.data)});case L:return Object(d.a)({},e,Object(U.a)({draft:{fetching:!1,error:null}},t.order,t.data));case z:return Object(d.a)({},e,{draft:Object(d.a)({},e.draft,{fetching:!1,errors:t.errors})});default:return e}},products:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:re,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case G:return Object(d.a)({},e,{recommendations:t.recommendations});case X:return Object(d.a)({},e,{byCategory:Object(d.a)({},e.byCategory,Object(U.a)({},t.category,t.products))});case Z:return Object(d.a)({},e,{byQuery:Object(d.a)({},e.byQuery,Object(U.a)({},t.query,{fetching:!0,products:[]}))});case ee:return Object(d.a)({},e,{byQuery:Object(d.a)({},e.byQuery,Object(U.a)({},t.query,{fetching:!1,products:t.products}))});case ae:return Object(d.a)({},e,{byId:Object(d.a)({},e.byId,Object(U.a)({},t.id,{fetching:!0,product:null}))});case ne:return Object(d.a)({},e,{byId:Object(d.a)({},e.byId,Object(U.a)({},t.id,{fetching:!1,product:t.product}))});default:return e}}}),Object(m.a)(u.a)),le=a(12),ie=a(103),se=a(249),me=a(223),ue=a(93),de=function(e){var t=e.handleToggleModal;return c.a.createElement(ue.a,{color:"link",className:"arrow-back px-2 py-2",onClick:t,"aria-label":"back"},c.a.createElement("img",{src:"/assets/icons/icon-arrow.svg",alt:"back"}))},pe=function(e){var t=e.handleToggleModal;return c.a.createElement(ue.a,{color:"link",className:"btn-close float-none px-2 py-2",onClick:t,"aria-label":"close"},c.a.createElement("img",{src:"/assets/icons/icon-close.svg",alt:"close"}))},ge=function(e){var t=e.title,a=e.content,n=e.isBackBtn,r=e.isCloseBtn,o=e.isOpen,l=e.handleToggleModal,i=Object(ie.a)(e,["title","content","isBackBtn","isCloseBtn","isOpen","handleToggleModal"]);return c.a.createElement(se.a,Object.assign({title:t,isOpen:o,toggle:l,content:a},i),c.a.createElement(me.a,null,t,n&&c.a.createElement(de,{handleToggleModal:l}),r&&c.a.createElement(pe,{handleToggleModal:l})),a)},be=a(226),fe=a(4),he=a.n(fe),Ee=a(224),ve=a(225);var ye=function(e){var t=e.income,a=e.outcome,n=e.date,r=e.from,o=e.message;return c.a.createElement("div",{className:he()("chat__message",{"-income":t,"-outcome":a})},c.a.createElement("div",{className:"chat__message--date"},r," @ ",function(e){var t=new Date(e);return"".concat(t.getHours(),":").concat(t.getMinutes())}(n)),c.a.createElement("div",{className:"chat__message--inner"},o))},Ne=function(e){var t=e.isWebsocketConnected,a=e.messages,r=e.sendMessage,o=Object(n.useState)(""),l=Object(le.a)(o,2),i=l[0],s=l[1];return c.a.createElement("div",{className:"chat__inner"},c.a.createElement("div",{className:"chat__body"},a.map(function(e){return c.a.createElement(ye,{key:e.id,income:!0,date:e.date,from:e.user,message:e.text})})),c.a.createElement("div",{className:"chat__footer"},c.a.createElement(Ee.a,{onSubmit:function(e){e.preventDefault(),t&&(r(i),s(""))},className:"form-inline form-inline-flex"},c.a.createElement(ve.a,{value:i,onChange:function(e){return s(e.target.value)},className:"form-control mr-2",type:"text"}),c.a.createElement(ue.a,{type:"submit",color:"link",className:"btn btn-send"},c.a.createElement("img",{src:"/assets/icons/icon-send.svg",alt:""})))))},ke=a(95),Oe=a.n(ke),je=a(96),xe=a.n(je).a.create({validateStatus:function(e){return 401===e?(localStorage.removeItem("token"),void window.location.reload(!0)):e<=399}});function Se(){return function(e,t){e({type:A});var a=t().auth.token;xe.get("/api/messages",{headers:{Authorization:"Bearer ".concat(a)}}).then(function(t){e({type:D,messages:t.data.messages})}).catch(function(t){e({type:W,error:t.response.data.error})})}}function Ce(e){return{type:P,message:e}}function we(){return function(e,t){var a=t();if(!a.auth.me.fetching&&!a.auth.me.profile){e({type:C});var n=a.auth.token;xe.get("/api/me",{headers:{Authorization:"Bearer ".concat(n)}}).then(function(t){e({type:w,profile:t.data})}).catch(function(t){e({type:I,error:t.response.data.error})})}}}var Ie=null;var Fe=Object(l.b)(function(e){return{token:e.auth.token,me:e.auth.me,isWebsocketConnected:e.chat.isWebsocketConnected,messages:e.chat.messages}},function(e){return Object(d.a)({dispatch:e},Object(m.b)({fetchMessages:Se,sendMessage:Ce,fetchMe:we},e))})(function(e){var t=e.token,a=e.isWebsocketConnected,r=e.messages,o=e.me,l=e.isCollapsed,i=e.isFixed,s=e.dispatch,m=e.fetchMessages,u=e.sendMessage,d=e.fetchMe,p=Object(n.useState)(!1),g=Object(le.a)(p,2),b=g[0],f=g[1];function h(e){Ie.emit("message",e),u({text:e,user:o.profile.displayName,date:Date.now(),id:Date.now()})}return Object(n.useEffect)(function(){d(),m(),(Ie=Oe()("?token=".concat(t))).on("connect",function(){s({type:q})}),Ie.on("disconnect",function(){s({type:_})}),Ie.on("message",function(e){s({type:P,message:e})})},[]),o.fetching||!o.profile?null:c.a.createElement("div",{className:he()("chat",{fixed:i})},l&&c.a.createElement("div",{className:"chat__header",onClick:function(){f(!b)}},"\u0415\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441?",c.a.createElement("img",{src:"/assets/icons/icon-chat-white.svg",alt:"icon-chat"})),l?c.a.createElement(be.a,{isOpen:b},c.a.createElement(Ne,{isWebsocketConnected:a,sendMessage:h,messages:r})):c.a.createElement(Ne,{isWebsocketConnected:a,sendMessage:h,messages:r}))}),Te=function(e){var t=e.data;return c.a.createElement("div",{className:"modal-menu"},t&&t.map(function(e,t){return c.a.createElement(i.b,{to:e.src,key:t,className:"modal-menu__item"},e.title)}))},Be=function(){var e=Object(n.useState)(!1),t=Object(le.a)(e,2),a=t[0],c=t[1];return{isOpen:a,handleToggleModal:function(){c(!a)}}},Re=function(e){var t=e.context,a=e.isChat,r=Object(n.useContext)(t),o=Be(),l=o.isOpen,i=o.handleToggleModal;return c.a.createElement(c.a.Fragment,null,c.a.createElement(ge,{title:r.title,content:r.modalComponent,isBackBtn:!0,isCloseBtn:!0,isOpen:l,handleToggleModal:i}),c.a.createElement(ue.a,{color:"link",className:"modal-menu__item is-submenu w-100",onClick:i},r.title," ",a&&c.a.createElement("img",{src:"assets/icons/icon-chat.svg",alt:""})))},Me=a(227),qe=c.a.createContext(),_e=function(e){var t=e.item;return c.a.createElement(qe.Provider,{value:t},c.a.createElement(Re,{context:qe,isChat:t.isChat}))},Pe=Object(s.e)(function(e){var t=e.token,a=e.categories,r=e.history,o=Object(n.useState)(""),l=Object(le.a)(o,2),s=l[0],m=l[1];return c.a.createElement("div",{className:"modal-menu"},!t&&c.a.createElement(c.a.Fragment,null,c.a.createElement(i.b,{to:"/login",className:"modal-menu__item"},"\u0412\u0445\u043e\u0434"),c.a.createElement(i.b,{to:"/register",className:"modal-menu__item"},"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f")),!!t&&c.a.createElement(_e,{item:{title:"\u0415\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441?",modalComponent:c.a.createElement(Fe,null),isChat:!0}}),c.a.createElement("div",{className:"modal-menu__item"},c.a.createElement(Ee.a,{inline:!0},c.a.createElement(Me.a,{style:{marginBottom:0}},c.a.createElement(ve.a,{type:"text",name:"query",value:s,onChange:function(e){return m(e.target.value)},placeholder:"\u041f\u043e\u0438\u0441\u043a"})),c.a.createElement(ue.a,{onClick:function(e){e.preventDefault(),s.length&&r.push("/search?query=".concat(s))}},"\u041d\u0430\u0439\u0442\u0438"))),c.a.createElement("h3",{className:"h6 mb-0 modal-menu__title"},"\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438"),a.map(function(e){var t={title:e.title,modalComponent:c.a.createElement(Te,{data:e.subcategories.map(function(e){return{title:e.title,src:"/category/".concat(e.id)}})}),isChat:!1};return c.a.createElement(_e,{key:e.id,item:t})}))}),Ae=a(35),De=a.n(Ae);function We(){return function(e,t){0===t().categories.length&&(e({type:T}),xe.get("/api/categories").then(function(t){e({type:B,categories:t.data.categories})}).catch(function(t){e({type:R,error:t.response.data.error})}))}}var Qe=a(228),Ue=a(229),He=a(230),Le=a(231);var ze={fetchCategories:We},Je=Object(s.e)(Object(l.b)(function(e){return{token:e.auth.token,categories:e.categories}},ze)(function(e){var t=e.token,a=e.categories,r=e.fetchCategories,o=e.history,l=e.location,s=De.a.parse(l.search),m=Be(),u=m.isOpen,d=m.handleToggleModal,p=Object(n.useState)(!1),g=Object(le.a)(p,2),b=g[0],f=g[1],h=Object(n.useState)(s.query||""),E=Object(le.a)(h,2),v=E[0],y=E[1];return Object(n.useEffect)(function(){v!==s.query&&y(s.query||""),u&&d()},[l.search]),Object(n.useEffect)(function(){u&&d()},[l.pathname]),Object(n.useEffect)(function(){r()},[]),c.a.createElement("header",null,c.a.createElement(Qe.a,{light:!0,expand:"lg"},c.a.createElement("div",{className:"container"},c.a.createElement("div",null,c.a.createElement(Ue.a,{onClick:function(){f(!b)},className:"d-none d-md-inline-flex d-lg-none"},c.a.createElement("img",{src:"/assets/icons/icon-menu.svg",alt:"menu icon"})),c.a.createElement(ge,{title:"\u041c\u0435\u043d\u044e",content:c.a.createElement(Pe,{token:t,categories:a}),id:"xsMenuModal",isCloseBtn:!0,isOpen:u,handleToggleModal:d}),c.a.createElement(Ue.a,{onClick:d,className:"d-inline-flex d-md-none"},c.a.createElement("img",{src:"/assets/icons/icon-menu.svg",alt:"menu icon"})),c.a.createElement(i.b,{to:"/",className:"navbar-brand"},c.a.createElement("strong",null,"AnyShop"))),c.a.createElement(be.a,{isOpen:b,navbar:!0},c.a.createElement(He.a,{className:"mr-auto",navbar:!0},c.a.createElement(Le.a,null,c.a.createElement(Ee.a,{onSubmit:function(e){e.preventDefault(),o.push("/search?query=".concat(v))},inline:!0,className:"my-2 my-md-0 ml-lg-5"},c.a.createElement(ve.a,{className:"form-control mr-sm-2",type:"text",placeholder:"\u041f\u043e\u0438\u0441\u043a","aria-label":"Search",value:v,onChange:function(e){return y(e.target.value)}}),c.a.createElement(ue.a,{type:"submit",color:"primary",outline:!0},"\u041f\u043e\u0438\u0441\u043a")))),!t&&c.a.createElement("div",null,c.a.createElement(i.b,{to:"/login",className:"text-muted"},"\u0412\u0445\u043e\u0434")," | ",c.a.createElement(i.b,{to:"/register",className:"text-muted"},"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f")),!!t&&c.a.createElement("a",{onClick:function(e){e.preventDefault(),localStorage.removeItem("token"),window.location.href="/"},href:"#",className:"text-muted"},"\u0412\u044b\u0439\u0442\u0438")))))}));var Ve=function(){return c.a.createElement("footer",{className:"footer"},c.a.createElement("div",{className:"container"},c.a.createElement("div",{className:"footer-inner"},c.a.createElement("div",{className:"footer-menu"},c.a.createElement(i.b,{to:"#",className:"text-muted"},"\u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f"),c.a.createElement("span",{className:"d-none d-md-inline-flex footer-menu-separator"},"|"),c.a.createElement(i.b,{to:"#",className:"text-muted"},"\u041a\u043e\u043d\u0444\u0438\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c"),c.a.createElement("span",{className:"d-none d-md-inline-flex footer-menu-separator"},"|"),c.a.createElement(i.b,{to:"#",className:"text-muted"},"Cookies"),c.a.createElement("span",{className:"d-none d-md-inline-flex footer-menu-separator"},"|"),c.a.createElement(i.b,{to:"#",className:"text-muted"},"\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u044f")),c.a.createElement("div",null,"\xa9 1998-2019, AnyShop.com, Inc."))))};var Ge=Object(l.b)(function(e){return{token:e.auth.token}})(function(e){var t=e.token,a=e.children;return c.a.createElement(c.a.Fragment,null,c.a.createElement(Je,null),c.a.createElement("main",{role:"main"},!!t&&c.a.createElement("div",{className:"d-none d-lg-block"},c.a.createElement(Fe,{isFixed:!0,isCollapsed:!0})),a),c.a.createElement(Ve,null))}),Ke=a(236),$e=a(237),Xe=a(232),Ye=a(233),Ze=a(234),et=a(235),tt=function(e){var t=e.dropdownTitle,a=e.dropdownItems,r=Object(n.useState)(!1),o=Object(le.a)(r,2),l=o[0],s=o[1];return c.a.createElement(Xe.a,{isOpen:l,toggle:function(){s(!l)}},c.a.createElement(Ye.a,{caret:!0,tag:"a",className:"nav-link"},t),c.a.createElement(Ze.a,null,a.map(function(e,t){return c.a.createElement(et.a,{key:t},c.a.createElement(i.b,{key:e.id,to:"/category/".concat(e.id)},e.title))})))},at=function(e){var t=e.categories;return c.a.createElement("div",{className:"d-none d-md-block"},c.a.createElement("div",{className:"backdrop"}),c.a.createElement(Ke.a,{className:"sidebar"},t.map(function(e){return c.a.createElement($e.a,{key:e.id},c.a.createElement(tt,{dropdownTitle:e.title,dropdownItems:e.subcategories}))})))},nt=a(45),ct=a(46),rt=a(48),ot=a(47),lt=a(49),it=a(13),st=a(101),mt=a(238),ut=a(239),dt=a(240),pt=[{id:"0",originalTitle:"\u0418\u0433\u0440\u0443\u0448\u043a\u0438 \u0438 \u0440\u0430\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f",src:"/assets/images/default-slide-img.jpg",altText:"\u0418\u0433\u0440\u0443\u0448\u043a\u0438",captionTitle:"\u041b\u0443\u0447\u0448\u0438\u0435 \u0438\u0433\u0440\u0443\u0448\u043a\u0438",captionBtnText:"\u0421\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f",captionBtnIconSrc:"/assets/icons/icon-angle-white.svg"},{id:"1",originalTitle:"LCD \u0442\u0435\u043b\u0435\u0432\u0438\u0437\u043e\u0440\u044b",src:"/assets/images/default-slide-img.jpg",altText:"Slide 2",captionTitle:"\u041b\u0443\u0447\u0448\u0438\u0435 LCD \u0442\u0435\u043b\u0435\u0432\u0438\u0437\u043e\u0440\u044b",captionBtnText:"\u0421\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f",captionBtnIconSrc:"/assets/icons/icon-angle-white.svg"},{id:"2",originalTitle:"\u041d\u043e\u0443\u0442\u0431\u0443\u043a\u0438 \u0438 \u0430\u043a\u0441\u0435\u0441\u0441\u0443\u0430\u0440\u044b",src:"/assets/images/default-slide-img.jpg",altText:"Slide 3",captionTitle:"\u041b\u0443\u0447\u0448\u0438\u0435 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0438",captionBtnText:"\u0421\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f",captionBtnIconSrc:"/assets/icons/icon-angle-white.svg"}],gt=function(e){function t(e){var a;return Object(nt.a)(this,t),(a=Object(rt.a)(this,Object(ot.a)(t).call(this,e))).state={activeIndex:0},a.next=a.next.bind(Object(it.a)(Object(it.a)(a))),a.previous=a.previous.bind(Object(it.a)(Object(it.a)(a))),a.goToIndex=a.goToIndex.bind(Object(it.a)(Object(it.a)(a))),a.onExiting=a.onExiting.bind(Object(it.a)(Object(it.a)(a))),a.onExited=a.onExited.bind(Object(it.a)(Object(it.a)(a))),a}return Object(lt.a)(t,e),Object(ct.a)(t,[{key:"onExiting",value:function(){this.animating=!0}},{key:"onExited",value:function(){this.animating=!1}},{key:"next",value:function(){if(!this.animating){var e=this.state.activeIndex===pt.length-1?0:this.state.activeIndex+1;this.setState({activeIndex:e})}}},{key:"previous",value:function(){if(!this.animating){var e=0===this.state.activeIndex?pt.length-1:this.state.activeIndex-1;this.setState({activeIndex:e})}}},{key:"goToIndex",value:function(e){this.animating||this.setState({activeIndex:e})}},{key:"render",value:function(){var e=this,t=this.state.activeIndex,a=this.props.categories,n=pt.map(function(t){var n=a.reduce(function(e,a){if(e)return e;var n=a.subcategories.find(function(e){return e.title===t.originalTitle});return n||e},null);return c.a.createElement(st.a,{onExiting:e.onExiting,onExited:e.onExited,key:t.id},c.a.createElement("img",{src:t.src,alt:t.altText,className:"third-slide"}),c.a.createElement("div",{className:"container"},c.a.createElement("div",{className:"carousel-caption"},c.a.createElement("h3",{className:"h1"},t.captionTitle),c.a.createElement("div",null,c.a.createElement(i.b,{className:"btn",to:"/category/".concat(n.id),role:"button"},t.captionBtnText,c.a.createElement("img",{src:t.captionBtnIconSrc,className:"ml-3",alt:""}))))))});return c.a.createElement(mt.a,{activeIndex:t,next:this.next,previous:this.previous,className:"main-carousel"},c.a.createElement(ut.a,{items:pt,activeIndex:t,onClickHandler:this.goToIndex}),n,c.a.createElement(dt.a,{direction:"prev",directionText:"Previous",onClickHandler:this.previous}),c.a.createElement(dt.a,{direction:"next",directionText:"Next",onClickHandler:this.next}))}}]),t}(n.Component),bt=a(246),ft=a(241),ht=a(242),Et=a(243),vt=a(244),yt=a(245),Nt=function(e){var t=e.url,a=e.cardTitle,n=e.cardImgSrc,r=(e.cardRate,e.cardRateAmount,e.cardPrice);e.cardOldPrice,e.discount;return c.a.createElement(ft.a,{tag:i.b,to:t},c.a.createElement("div",{className:"card-img-wrap"},c.a.createElement(ht.a,{width:"100%",className:"card-img-top",src:n,alt:"Card image cap"})),c.a.createElement(Et.a,null,c.a.createElement(vt.a,null,a),c.a.createElement("div",{className:"flex-grow"}),c.a.createElement(yt.a,{className:he()("price-text")},r)))},kt=new Intl.NumberFormat("ru-RU",{style:"currency",currency:"RUB"});var Ot=function(e){var t=e.items;return c.a.createElement(c.a.Fragment,null,c.a.createElement("h3",{className:"section-title"},"\u041b\u0443\u0447\u0448\u0438\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0430\u0441"),c.a.createElement(bt.a,{className:"homepage-cards"},t.map(function(e){return c.a.createElement(Nt,{key:e.id,url:"/product/".concat(e.id),cardTitle:e.title,cardImgSrc:e.images[0],cardRate:!0,cardRateAmount:"121",cardPrice:kt.format(e.price),cardOldPrice:"250",discount:!0})})))};function jt(){return c.a.createElement("div",{className:"container"},c.a.createElement("h2",null,"Loading..."))}var xt=a(62),St=a.n(xt);function Ct(e){return function(t,a){var n=a();!1!==St()(n,"products.byId[".concat(e,"].fetching"))&&(t({type:ae,id:e}),xe.get("/api/products/".concat(e)).then(function(a){t({type:ne,id:e,product:a.data.product})}).catch(function(a){t({type:ce,id:e,error:a.response.data.error})}))}}var wt={fetchCategories:We,fetchRecommendations:function(){return function(e,t){0===t().products.recommendations.length&&(e({type:V}),xe.get("/api/recommendations").then(function(t){e({type:G,recommendations:t.data.recommendations})}).catch(function(t){e({type:K,error:t.response.data.error})}))}}},It=Object(l.b)(function(e){return{categories:e.categories,recommendations:e.products.recommendations}},wt)(function(e){var t=e.categories,a=e.recommendations,r=e.fetchCategories,o=e.fetchRecommendations;return Object(n.useEffect)(function(){r(),o()},[]),t.length&&a.length?c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"backdrop"}),c.a.createElement("div",{className:"container"},c.a.createElement("div",{className:"row flex-column-reverse flex-lg-row"},c.a.createElement("div",{className:"col-lg-3"},c.a.createElement(at,{categories:t})),c.a.createElement("div",{className:"col-lg-9"},c.a.createElement(gt,{categories:t})))),c.a.createElement("div",{className:"container"},c.a.createElement("div",{className:"row justify-content-end"},c.a.createElement("div",{className:"col-lg-9"},c.a.createElement(Ot,{items:a}))))):c.a.createElement(jt,null)});function Ft(e){var t=Object(n.useState)({}),a=Object(le.a)(t,2),r=a[0],o=a[1];function l(e){o(Object(d.a)({},r,Object(U.a)({},e.target.name,e.target.value)))}return c.a.createElement("div",{className:"container pt-5"},c.a.createElement("div",{className:"row justify-content-center"},c.a.createElement("div",{className:"col-md-6"},c.a.createElement("form",{onSubmit:function(t){return e.onSubmit(t,r)}},!!e.error&&c.a.createElement("div",{className:"alert alert-danger",role:"alert"},e.error),c.a.createElement("div",{className:"jumbotron jumbotron-light jumbotron-form"},e.fields.map(function(e){return c.a.createElement("div",{className:"form-group",key:e.id},c.a.createElement("label",{htmlFor:e.id},e.label),c.a.createElement("input",{type:e.type,className:"form-control",id:e.id,placeholder:e.placeholder,name:e.name,value:r[e.name]||"",onChange:l,required:!0}))}),c.a.createElement("button",{disabled:e.disabled,type:"submit",className:"btn btn-primary btn-lg"},e.submitButton),c.a.createElement("div",{className:"form-footer mt-4"},c.a.createElement(e.Footer,null)))),c.a.createElement("div",{className:"h4 text-center font-weight-normal text-uppercase my-5 d-none d-lg-block"},"\u0438\u043b\u0438"),c.a.createElement("div",{className:"socials mb-5"},c.a.createElement("a",{href:"#",className:"btn btn-primary btn-social -fb"},c.a.createElement("img",{src:"/assets/icons/icon-facebook.svg",alt:""}),"Facebook"),c.a.createElement("a",{href:"#",className:"btn btn-primary btn-social -vk"},c.a.createElement("img",{src:"/assets/icons/icon-vk.svg",alt:""}),"Vkontakte"),c.a.createElement("a",{href:"#",className:"btn btn-primary btn-social -twitter"},c.a.createElement("img",{src:"/assets/icons/icon-twitter.svg",alt:""}),"Twitter")))))}var Tt=[{label:"Email",type:"email",id:"email",name:"email",placeholder:"Email"},{label:"\u041f\u0430\u0440\u043e\u043b\u044c",type:"password",id:"password",name:"password",placeholder:"\u041f\u0430\u0440\u043e\u043b\u044c"}];var Bt={loginAction:function(e){var t=e.email,a=e.password;return function(e,n){e({type:p}),xe.post("/api/login",{email:t,password:a}).then(function(t){e({type:b,token:t.data.token})}).catch(function(t){e({type:g,error:t.response.data.error})})}}},Rt=Object(l.b)(function(e){return{login:e.auth.login,token:e.auth.token}},Bt)(function(e){var t=e.token,a=e.login,n=e.loginAction;return t?c.a.createElement(s.a,{to:"/"}):c.a.createElement(Ft,{disabled:a.processing,title:"\u0412\u0445\u043e\u0434",error:a.error,onSubmit:function(e,t){e.preventDefault(),a.processing||n(t)},fields:Tt,submitButton:"\u0412\u043e\u0439\u0442\u0438",Footer:function(){return c.a.createElement(c.a.Fragment,null,"\u041d\u0435\u0442 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430? ",c.a.createElement(i.b,{to:"/register"},"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f"))}})}),Mt={vkontakte:"VK",fb:"Facebook",github:"Github"};var qt={oauthCallbackAction:function(e){var t=e.provider,a=e.code;return function(e,n){e({type:j}),xe.post("/api/oauth_callback",{provider:t},{params:{code:a}}).then(function(t){e({type:S,token:t.data.token})}).catch(function(t){e({type:x,error:t.response.data.error})})}}},_t=Object(l.b)(function(e){return{oauthCallback:e.oauthCallback,token:e.token}},qt)(function(e){var t=e.token,a=e.oauthCallback,r=e.oauthCallbackAction,o=e.match,l=e.location;if(t)return c.a.createElement(s.a,{to:"/"});var m=new URLSearchParams(l.search),u=o.params.provider;return Object(n.useEffect)(function(){m.get("error")||r({code:m.get("code"),provider:u})},[]),c.a.createElement("main",{className:"container"},c.a.createElement("div",{className:"row login-form justify-content-center align-items-center"},c.a.createElement("div",{className:"col col-md-6"},c.a.createElement("div",{className:"text-center border border-light p-5"},c.a.createElement("p",{className:"h4 mb-4"},"\u041b\u043e\u0433\u0438\u043d \u0447\u0435\u0440\u0435\u0437 ",Mt[u]),a.error||m.get("error")?c.a.createElement(c.a.Fragment,null,c.a.createElement("p",{className:"text-danger"},"\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430."),c.a.createElement("p",{className:"text-danger"},a.error||""),c.a.createElement(i.b,{to:"/"},"\u0412\u0445\u043e\u0434")):c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435."),c.a.createElement("div",{className:"spinner-border",role:"status"},c.a.createElement("span",{className:"sr-only"},"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430...")))))))}),Pt=[{label:"Email",type:"email",id:"email",name:"email",placeholder:"Email"},{label:"\u0418\u043c\u044f",type:"text",id:"displayName",name:"displayName",placeholder:"\u0418\u043c\u044f"},{label:"\u041f\u0430\u0440\u043e\u043b\u044c",type:"password",id:"password",name:"password",placeholder:"\u041f\u0430\u0440\u043e\u043b\u044c"}];var At={registerAction:function(e){var t=e.email,a=e.displayName,n=e.password;return function(e,c){e({type:f}),xe.post("/api/register",{email:t,displayName:a,password:n}).then(function(t){e({type:E})}).catch(function(t){e({type:h,errors:t.response.data.errors})})}}},Dt=Object(l.b)(function(e){return{registration:e.auth.registration}},At)(function(e){var t=e.registration,a=e.registerAction;return t.complete?c.a.createElement("div",{className:"container pt-5"},c.a.createElement("div",{className:"row justify-content-center"},c.a.createElement("div",{className:"col-md-6"},c.a.createElement("div",{className:"text-center border border-light p-5"},c.a.createElement("p",{className:"h4 mb-4"},"\u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u0435\u043c, \u0432\u044b \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b!"),c.a.createElement("p",null,"\u041d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0432\u0430\u043c\u0438 \u043f\u043e\u0447\u0442\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u043f\u0438\u0441\u044c\u043c\u043e."),c.a.createElement("p",null,"\u0414\u043b\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u0438\u0441\u044c\u043c\u0430."))))):c.a.createElement(Ft,{disabled:t.processing,title:"\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f",validated:t.errors,errors:t.errors,onSubmit:function(e,n){e.preventDefault(),t.processing||a(n)},fields:Pt,submitButton:"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u043a\u043a\u0430\u0443\u043d\u0442",Footer:function(){return c.a.createElement("p",null,"\u0423\u0436\u0435 \u0435\u0441\u0442\u044c \u0430\u043a\u043a\u0430\u0443\u043d\u0442?\xa0",c.a.createElement(i.b,{to:"/login"},"\u0412\u0445\u043e\u0434"))}})});var Wt={confirmAction:function(e){var t=e.verificationToken;return function(e,a){e({type:v}),xe.post("/api/confirm",{verificationToken:t}).then(function(t){e({type:N,token:t.data.token})}).catch(function(t){e({type:y,error:t.response.data.error})})}}},Qt=Object(l.b)(function(e){return{confirmation:e.confirmation,token:e.token}},Wt)(function(e){var t=e.token,a=e.confirmation,r=e.confirmAction,o=e.match;return t?c.a.createElement(s.a,{to:"/"}):(Object(n.useEffect)(function(){r({verificationToken:o.params.verificationToken})},[]),c.a.createElement("main",{className:"container"},c.a.createElement("div",{className:"row login-form justify-content-center align-items-center"},c.a.createElement("div",{className:"col col-md-6"},c.a.createElement("div",{className:"text-center border border-light p-5"},c.a.createElement("p",{className:"h4 mb-4"},"\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430"),a.error?c.a.createElement(c.a.Fragment,null,c.a.createElement("p",{className:"text-danger"},"\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430."),c.a.createElement("p",{className:"text-danger"},a.error),c.a.createElement(i.b,{to:"/"},"\u0412\u0445\u043e\u0434")):c.a.createElement(c.a.Fragment,null,c.a.createElement("p",null,"\u041f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435."),c.a.createElement("div",{className:"spinner-border",role:"status"},c.a.createElement("span",{className:"sr-only"},"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430..."))))))))});function Ut(e){var t=e.category,a=e.categories,r=Object(n.useState)(t),o=Object(le.a)(r,2),l=o[0],s=o[1];return c.a.createElement("div",{className:"d-none d-lg-block col-lg-4 col-xl-3"},c.a.createElement("div",{id:"accordion",className:"aside-accordion-menu list-group"},a.map(function(e){return c.a.createElement("div",{className:"list-group-item",key:e.id},c.a.createElement("h5",{className:"mb-0",onClick:function(){return s(e.id)}},e.title," ",c.a.createElement("img",{src:"/assets/icons/icon-angle.svg",alt:"angle-right"})),c.a.createElement(be.a,{isOpen:l===e.id},c.a.createElement("ul",null,e.subcategories.map(function(e){return c.a.createElement("li",{key:e.id},c.a.createElement(i.b,{to:"/category/".concat(e.id)},e.title))}))))})))}var Ht=new Intl.NumberFormat("ru-RU",{style:"currency",currency:"RUB"});var Lt={fetchCategories:We,fetchProductsByCategory:function(e){return function(t,a){a().products.byCategory[e]||(t({type:$,category:e}),xe.get("/api/products",{params:{subcategory:e}}).then(function(a){t({type:X,category:e,products:a.data.products})}).catch(function(a){t({type:Y,category:e,error:a.response.data.error})}))}}},zt=Object(l.b)(function(e,t){return{categories:e.categories,products:e.products.byCategory[t.match.params.category]||[]}},Lt)(function(e){var t=e.categories,a=e.products,r=e.fetchCategories,o=e.fetchProductsByCategory,l=e.match;Object(n.useEffect)(function(){r(),o(l.params.category)},[l.params.category]);var s=Object(n.useState)(null),m=Object(le.a)(s,2),u=m[0],d=m[1],p=Object(n.useState)({}),g=Object(le.a)(p,2),b=g[0],f=g[1];return Object(n.useEffect)(function(){var e=!0,a=!1,n=void 0;try{for(var c,r=t[Symbol.iterator]();!(e=(c=r.next()).done);e=!0){var o=c.value,i=o.subcategories.find(function(e){return e.id===l.params.category});if(i){d(o.id),f(i);break}}}catch(s){a=!0,n=s}finally{try{e||null==r.return||r.return()}finally{if(a)throw n}}},[l.params.category,t.length]),t.length&&a.length?c.a.createElement("div",{className:"container"},c.a.createElement("div",{className:"row"},c.a.createElement(Ut,{categories:t,category:u}),c.a.createElement("div",{className:"col-lg-8 col-xl-9"},c.a.createElement("h3",{className:"h5 mt-4 mt-md-0 pt-1 mb-4"},b.title),a.map(function(e){return c.a.createElement("div",{className:"product-list-box",key:e.id},c.a.createElement("div",{className:"box-inner-col description-col"},c.a.createElement(i.b,{to:"/product/".concat(e.id),className:"product-img"},c.a.createElement("img",{src:e.images[0],alt:"img"})),c.a.createElement("div",{className:"product-desc"},c.a.createElement("h4",{className:"col-title mb-2"},c.a.createElement(i.b,{to:"/product/".concat(e.id)},e.title)),c.a.createElement("p",{className:"price-text mb-0 mt-2 d-inline-block d-md-none"},c.a.createElement("strong",null,Ht.format(e.price))))),c.a.createElement("div",{className:"box-inner-col price-col"},c.a.createElement("h4",{className:"col-title price-text mb-2"},Ht.format(e.price)),c.a.createElement("div",null,c.a.createElement(i.b,{to:"/checkout/".concat(e.id),className:"btn btn-primary btn-lg"},"\u041a\u0443\u043f\u0438\u0442\u044c"))))})))):c.a.createElement(jt,null)}),Jt=new Intl.NumberFormat("ru-RU",{style:"currency",currency:"RUB"});var Vt={fetchCategories:We,fetchProductsByQuery:function(e){return function(t,a){var n=a();!1!==St()(n,"products.byQuery[".concat(e,"].fetching"))&&(t({type:Z,query:e}),xe.get("/api/products",{params:{query:e}}).then(function(a){t({type:ee,query:e,products:a.data.products})}).catch(function(a){t({type:te,query:e,error:a.response.data.error})}))}}},Gt=Object(l.b)(function(e,t){var a=De.a.parse(t.location.search);return{categories:e.categories,products:e.products.byQuery[a.query]||{}}},Vt)(function(e){var t=e.categories,a=e.products,r=e.fetchCategories,o=e.fetchProductsByQuery,l=e.location,s=De.a.parse(l.search);return Object(n.useEffect)(function(){r(),o(s.query)},[s.query]),t.length&&a.products?c.a.createElement("div",{className:"container"},c.a.createElement("div",{className:"row"},c.a.createElement(Ut,{categories:t}),0!==a.products.length&&c.a.createElement("div",{className:"d-md-inline-flex d-lg-none col-lg-8 col-xl-9"},c.a.createElement("h4",{className:"col-title mb-2 mt-2"},"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430")),c.a.createElement("div",{className:"col-lg-8 col-xl-9"},0===a.products.length&&c.a.createElement("h4",{className:"col-title mb-2 mt-2"},"\u041f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 ".concat(s.query," \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c")),a.products.map(function(e){return c.a.createElement("div",{className:"product-list-box",key:e.id},c.a.createElement("div",{className:"box-inner-col description-col"},c.a.createElement(i.b,{to:"/product/".concat(e.id),className:"product-img"},c.a.createElement("img",{src:e.images[0],alt:"img"})),c.a.createElement("div",{className:"product-desc"},c.a.createElement("h4",{className:"col-title mb-2"},c.a.createElement(i.b,{to:"/product/".concat(e.id)},e.title)),c.a.createElement("p",{className:"price-text mb-0 mt-2 d-inline-block d-md-none"},c.a.createElement("strong",null,Jt.format(e.price))))),c.a.createElement("div",{className:"box-inner-col price-col"},c.a.createElement("h4",{className:"col-title price-text mb-2"},Jt.format(e.price)),c.a.createElement("div",null,c.a.createElement(i.b,{to:"/checkout/".concat(e.id),className:"btn btn-primary btn-lg"},"\u041a\u0443\u043f\u0438\u0442\u044c"))))})))):c.a.createElement(jt,null)});function Kt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;return t?e.split(" ").map(function(e){return t[e]||e}).join(" "):e}var $t=function(e){var t=e.items,a=e.activeIndex,n=e.cssModule,r=e.onClickHandler,o=e.className,l=Kt(he()(o,"carousel-indicators"),n),i=t.map(function(e,t){var o=Kt(he()({active:a===t}),n);return c.a.createElement("li",{key:"".concat(e.key||Object.values(e).join("")),onClick:function(e){e.preventDefault(),r(t)},className:o},c.a.createElement("img",{src:e,alt:"indicator-img-".concat(e.key)}))});return c.a.createElement("ol",{className:l},i)},Xt=function(e){function t(e){var a;return Object(nt.a)(this,t),(a=Object(rt.a)(this,Object(ot.a)(t).call(this,e))).state={activeIndex:0},a.next=a.next.bind(Object(it.a)(Object(it.a)(a))),a.previous=a.previous.bind(Object(it.a)(Object(it.a)(a))),a.goToIndex=a.goToIndex.bind(Object(it.a)(Object(it.a)(a))),a.onExiting=a.onExiting.bind(Object(it.a)(Object(it.a)(a))),a.onExited=a.onExited.bind(Object(it.a)(Object(it.a)(a))),a}return Object(lt.a)(t,e),Object(ct.a)(t,[{key:"onExiting",value:function(){this.animating=!0}},{key:"onExited",value:function(){this.animating=!1}},{key:"next",value:function(){if(!this.animating){var e=this.state.activeIndex===this.props.images.length-1?0:this.state.activeIndex+1;this.setState({activeIndex:e})}}},{key:"previous",value:function(){if(!this.animating){var e=0===this.state.activeIndex?this.props.images.length-1:this.state.activeIndex-1;this.setState({activeIndex:e})}}},{key:"goToIndex",value:function(e){this.animating||this.setState({activeIndex:e})}},{key:"render",value:function(){var e=this,t=this.state.activeIndex,a=this.props.images.map(function(t,a){return c.a.createElement(st.a,{onExiting:e.onExiting,onExited:e.onExited,key:a},c.a.createElement("div",{className:"img-wrap"},c.a.createElement("img",{src:t,alt:t.altText})))});return c.a.createElement(mt.a,{activeIndex:t,next:this.next,previous:this.previous,className:"product-carousel",images:this.props.images},c.a.createElement($t,{items:this.props.images,activeIndex:t,onClickHandler:this.goToIndex}),a,c.a.createElement(dt.a,{direction:"prev",directionText:"Previous",onClickHandler:this.previous}),c.a.createElement(dt.a,{direction:"next",directionText:"Next",onClickHandler:this.next}))}}]),t}(n.Component),Yt=new Intl.NumberFormat("ru-RU",{style:"currency",currency:"RUB"});var Zt={fetchProductById:Ct},ea=Object(l.b)(function(e,t){return{product:e.products.byId[t.match.params.id]||{}}},Zt)(function(e){var t=e.product,a=e.fetchProductById,r=e.match;return Object(n.useEffect)(function(){a(r.params.id)},[r.params.id]),t.fetching||!t.product?c.a.createElement(jt,null):c.a.createElement("div",{className:"container"},c.a.createElement("div",{className:"row"},c.a.createElement("div",{className:"col-lg-5"},c.a.createElement(Xt,{images:t.product.images})),c.a.createElement("div",{className:"col-lg-7"},c.a.createElement("div",{className:"product-info"},c.a.createElement("h3",{className:"h5"},t.product.title),c.a.createElement("div",{className:"row flex-column-reverse flex-lg-row"},c.a.createElement("div",{className:"col-md-7"},c.a.createElement("p",{className:"d-none d-lg-block"},t.product.description)),c.a.createElement("div",{className:"col-md-5"},c.a.createElement("h4",{className:"col-title price-text mb-2 mt-0"},Yt.format(t.product.price)),c.a.createElement(i.b,{to:"/checkout/".concat(t.product.id),className:"btn btn-primary btn-lg"},"\u041a\u0443\u043f\u0438\u0442\u044c")))))))}),ta=a(247),aa=a(248);var na=new Intl.NumberFormat("ru-RU",{style:"currency",currency:"RUB"});var ca={fetchProductById:Ct,fetchMe:we,checkout:function(e){return function(t,a){var n=a().auth.token;t({type:H,data:e}),xe.post("/api/orders",e,{headers:{Authorization:"Bearer ".concat(n)}}).then(function(a){t({type:L,data:e,order:a.data.order})}).catch(function(a){t({type:z,data:e,errors:a.response.data.errors})})}}},ra=Object(l.b)(function(e,t){return{product:e.products.byId[t.match.params.id]||{},draft:e.orders.draft,me:e.auth.me,token:e.auth.token}},ca)(function(e){var t=e.token,a=e.product,r=e.draft,o=e.me,l=e.fetchProductById,i=e.fetchMe,s=e.checkout,m=e.match,u=e.history;Object(n.useEffect)(function(){if(!t)return u.replace("/login")},[]),Object(n.useEffect)(function(){i(),l(m.params.id)},[m.params.id]);var d=Object(n.useState)("initial"),p=Object(le.a)(d,2),g=p[0],b=p[1],f=Object(n.useState)("+71111212123"),h=Object(le.a)(f,2),E=h[0],v=h[1],y=Object(n.useState)("\u041a\u0440\u0430\u0441\u043d\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c, \u041c\u043e\u0441\u043a\u0432\u0430, \u0420\u043e\u0441\u0441\u0438\u044f"),N=Object(le.a)(y,2),k=N[0],O=N[1];return Object(n.useEffect)(function(){!0!==r.fetching?r.errors&&"pending"===g?b("initial"):r.errors||"pending"!==g||b("complete"):b("pending")},[r]),a.fetching||!a.product||o.fetching||!o.profile?c.a.createElement(jt,null):c.a.createElement("div",{className:"container"},c.a.createElement("div",{className:"row justify-content-center"},c.a.createElement("div",{className:"col-lg-10"},c.a.createElement(Ee.a,{onSubmit:function(e){e.preventDefault(),s({product:m.params.id,phone:E,address:k})}},c.a.createElement("h3",{className:"h5 mb-4 mt-4 text-md-center"},"\u0412\u0430\u0448 \u0437\u0430\u043a\u0430\u0437"),!!r.errors&&Object.keys(r.errors).map(function(e){return c.a.createElement(ta.a,{color:"warning",key:e},r.errors[e])}),"complete"===g&&c.a.createElement(ta.a,{color:"primary"},"\u0412\u0430\u0448 \u0437\u0430\u043a\u0430\u0437 \u0431\u044b\u043b \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d. \u041d\u0430 \u0432\u0430\u0448 email \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435."),c.a.createElement("div",{className:"product-list-box"},c.a.createElement("div",{className:"box-inner-col description-col"},c.a.createElement("div",{className:"product-img"},c.a.createElement("img",{src:a.product.images[0],alt:"img"})),c.a.createElement("div",{className:"product-desc"},c.a.createElement("h4",{className:"col-title mb-2"},a.product.title),c.a.createElement("p",{className:"price-text mb-0 mt-2 d-inline-block d-md-none"},c.a.createElement("strong",null,na.format(a.product.price))))),c.a.createElement("div",{className:"box-inner-col price-col justify-content-center"},c.a.createElement("p",{className:"mb-0 font-weight-light"},"Total:"),c.a.createElement("h4",{className:"col-title price-text mb-2"},na.format(a.product.price)))),c.a.createElement("h3",{className:"h5 mb-4 mt-5 text-md-center"},"\u0414\u0435\u0442\u0430\u043b\u0438 \u0437\u0430\u043a\u0430\u0437\u0430"),c.a.createElement("div",{className:"jumbotron jumbotron-light jumbotron-form mb-0"},c.a.createElement("div",{className:"row"},c.a.createElement("div",{className:"col-md-6"},c.a.createElement(Me.a,null,c.a.createElement(aa.a,{for:"exampleInput"},"\u0418\u043c\u044f:"),c.a.createElement(ve.a,{disabled:!0,value:o.profile.displayName,type:"text",className:"form-control",id:"exampleInput"})),c.a.createElement(Me.a,{className:"mb-4"},c.a.createElement(aa.a,{for:"exampleInput2"},"Email:"),c.a.createElement("input",{disabled:!0,value:o.profile.email,type:"email",className:"form-control",id:"exampleInput2"}))),c.a.createElement("div",{className:"col-md-6"},c.a.createElement(Me.a,null,c.a.createElement(aa.a,{for:"exampleInput3"},"\u0422\u0435\u043b\u0435\u0444\u043e\u043d:"),c.a.createElement("input",{value:E,type:"text",className:"form-control",id:"exampleInput3",disabled:"complete"===g,onChange:function(e){return v(e.target.value)},placeholder:"+7 111 12 12 123"})),c.a.createElement(Me.a,{className:"mb-4"},c.a.createElement(aa.a,{for:"exampleInput4"},"\u0410\u0434\u0440\u0435\u0441:"),c.a.createElement(ve.a,{value:k,type:"text",className:"form-control",id:"exampleInput4",onChange:function(e){return O(e.target.value)},disabled:"complete"===g,placeholder:"\u041a\u0440\u0430\u0441\u043d\u0430\u044f \u043f\u043b\u043e\u0449\u0430\u0434\u044c, \u041c\u043e\u0441\u043a\u0432\u0430, \u0420\u043e\u0441\u0441\u0438\u044f"}))))),c.a.createElement("div",{className:"text-center mt-2 mb-5 my-sm-5"},c.a.createElement(ue.a,{disabled:"complete"===g,type:"submit",color:"primary",size:"lg"},"\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0438 \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c"))))))});o.a.render(c.a.createElement(l.a,{store:oe},c.a.createElement(i.a,null,c.a.createElement(Ge,null,c.a.createElement(s.b,{exact:!0,path:"/",component:It}),c.a.createElement(s.b,{path:"/login",component:Rt}),c.a.createElement(s.b,{path:"/oauth/:provider",component:_t}),c.a.createElement(s.b,{path:"/register",component:Dt}),c.a.createElement(s.b,{path:"/confirm/:verificationToken",component:Qt}),c.a.createElement(s.b,{path:"/category/:category",component:zt}),c.a.createElement(s.b,{path:"/search",component:Gt}),c.a.createElement(s.b,{path:"/product/:id",component:ea}),c.a.createElement(s.b,{path:"/checkout/:id",component:ra})))),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(e){e.unregister()})}},[[104,1,2]]]);
//# sourceMappingURL=main.49dcd2d4.chunk.js.map